#include <iostream>

class Base
{
public:
    int value1;
    int value2;
    Base()
    {
        value1 = 1;
    }
    Base(int val) : Base() //委托Base()构造函数
    {
        value2 = val;
    }
};

class Subclass : public Base {
public:
    using Base::Base; //继承构造
};

struct BaseStruct
{
    virtual void foo();
};
struct SubStruct : BaseStruct
{
    void foo() override;
};



int main() {
    Subclass s(3);
    std::cout << s.value1 << std::endl;
    std::cout << s.value2 << std::endl;

    return 0;
}